package routers

import (
	"github.com/gin-gonic/gin"
	v1 "perfect-admin/api/v1"
	"perfect-admin/middleware"
)

func InitApiRouter(Router *gin.RouterGroup)  {
	ApiRouter := Router.Group("api").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
	{
		ApiRouter.GET("/getApiList", v1.GetApiList)
		ApiRouter.GET("/getApiTree", v1.GetApiTree)
		ApiRouter.GET("/getApiGroup", v1.GetApiGroup)
		ApiRouter.POST("/addApi", v1.AddApi)
		ApiRouter.PUT("/updateApi", v1.UpdateApi)
		ApiRouter.DELETE("/deleteApi", v1.DeleteApi)
	}
}
